#include <iostream>

#define N 100

using namespace std;

void find(char *str1,char*str2,int a[N]);

int main( )
{
    char a[N],b[N],*str1,*str2;
    int i,aa[N],*p=aa;

    for(i=0;i<N;i++) aa[i]=0;

    str1=a;
    str2=&b[0];


    cout<<"enter the string"<<endl;
    cin>>str1;
    cout<<"enter the char need to find"<<endl;
    cin>>b;



    find(str1,str2,p);

    while(*(p)!=0) 
        {
            cout<<*p<<"  ";
            p++;
        }

    cin>>i;
    return 0;
}

void find(char *str1,char*str2,int *a)
{
    int i=0,n=0,m=0;
    char *p1,*p2;
    p1=str1;
    p2=str2;

    while(*p1!='\0')
    {   
        i++;
        while(*p1==*p2)
        {   
            p1++;
            p2++;
            if(*p2=='\0')
            {
                *(a+n)=i;
                n++;
             }
        }

        p1=++str1;
        p2=str2;        
    }
      
}


